From df09109d81f71c47a8d64086c052d4006d90be1e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Sep 2013 09:34:13 +0200 Subject: [PATCH] overviewControls: Use a custom layout to catch all geometry changes We currently update workspaces geometry when we are notified about allocation changes of the overview group; however as the geometry is based on stage coordinates, we miss notifications when the allocation relative to the parent is unchanged, which happens when the primary monitor's position changes but not its resolution. Use a custom layout manager to give us a signal that is emitted reliably. https://bugzilla.gnome.org/show_bug.cgi?id=708009 --- js/ui/overviewControls.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index 12ab2aa97..c16c4ac54 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -504,6 +504,17 @@ const MessagesIndicator = new Lang.Class({ } }); +const ControlsLayout = new Lang.Class({ + Name: 'ControlsLayout', + Extends: Clutter.BinLayout, + Signals: { 'allocation-changed': { flags: GObject.SignalFlags.RUN_LAST } }, + + vfunc_allocate: function(container, box, flags) { + this.parent(container, box, flags); + this.emit('allocation-changed'); + } +}); + const ControlsManager = new Lang.Class({ Name: 'ControlsManager', @@ -524,7 +535,8 @@ const ControlsManager = new Lang.Class({ this._indicator = new MessagesIndicator(this.viewSelector); this.indicatorActor = this._indicator.actor; - this.actor = new St.Widget({ layout_manager: new Clutter.BinLayout(), + let layout = new ControlsLayout(); + this.actor = new St.Widget({ layout_manager: layout, reactive: true, x_expand: true, y_expand: true, clip_to_allocation: true }); @@ -539,7 +551,7 @@ const ControlsManager = new Lang.Class({ expand: true }); this._group.add_actor(this._thumbnailsSlider.actor); - this._group.connect('notify::allocation', Lang.bind(this, this._updateWorkspacesGeometry)); + layout.connect('allocation-changed', Lang.bind(this, this._updateWorkspacesGeometry)); Main.overview.connect('showing', Lang.bind(this, this._updateSpacerVisibility)); Main.overview.connect('item-drag-begin', Lang.bind(this, -- 2.39.5